<style include="settings-shared"></style>

<!-- Data model. -->
<settings-languages languages="{{languages}}" prefs="{{prefs}}"
    language-helper="{{languageHelper}}">
</settings-languages>

<!-- Top-level settings section. -->
<settings-animated-pages id="pages" section="osLanguages"
    focus-config="[[focusConfig_]]">
  <div route-path="default">
    <cr-link-row
        id="languagesPageTrigger"
        label="$i18n{languagesPageTitle}"
        sub-label="[[getLanguageDisplayName_(
            languages.prospectiveUILanguage, languageHelper)]]"
        on-click="onLanguagesV2Click_"
        role-description="$i18n{subpageArrowRoleDescription}">
    </cr-link-row>
    <cr-link-row
        class="hr"
        id="inputPageTrigger"
        label="[[inputPageTitle_]]"
        sub-label="[[getInputMethodDisplayName_(
          languages.inputMethods.currentId, languageHelper)]]"
        on-click="onInputClick_"
        role-description="$i18n{subpageArrowRoleDescription}">
    </cr-link-row>
    <template is="dom-if" if="[[smartInputsEnabled_]]">
      <cr-link-row
          class="hr"
          id="smartInputsSubpageTrigger"
          label="$i18n{smartInputsTitle}"
          on-click="onSmartInputsClick_"
          role-description="$i18n{subpageArrowRoleDescription}">
      </cr-link-row>
    </template>
  </div>

  <!-- "Languages" page. -->
  <template is="dom-if" route-path="/osLanguages/languages">
    <settings-subpage page-title="$i18n{languagesPageTitle}">
      <os-settings-languages-page-v2
          language-helper="[[languageHelper]]"
          languages="[[languages]]"
          prefs="{{prefs}}">
      </os-settings-languages-page-v2>
    </settings-subpage>
  </template>

  <!-- "Input" page. -->
  <template is="dom-if" route-path="/osLanguages/input">
    <settings-subpage page-title="[[inputPageTitle_]]">
      <os-settings-input-page language-helper="[[languageHelper]]"
          languages="[[languages]]" prefs="{{prefs}}"
          focus-config="[[focusConfig_]]">
      </os-settings-input-page>
    </settings-subpage>
  </template>

  <!-- "Smart inputs" sub-page. -->
  <template is="dom-if" route-path="/osLanguages/smartInputs">
    <settings-subpage page-title="$i18n{smartInputsTitle}">
      <os-settings-smart-inputs-page prefs="{{prefs}}">
      </os-settings-smart-inputs-page>
    </settings-subpage>
  </template>

  <!-- "Input method settings" sub-sub-page. -->
  <template is="dom-if" route-path="/osLanguages/inputMethodOptions">
    <settings-subpage>
      <settings-input-method-options-page
          language-helper="[[languageHelper]]"
          prefs="{{prefs}}">
      </settings-input-method-options-page>
    </settings-subpage>
  </template>

  <!-- "Customize spell check" sub-sub-page. -->
  <template is="dom-if" route-path="/osLanguages/editDictionary">
    <settings-subpage page-title="$i18n{editDictionaryLabel}">
      <os-settings-edit-dictionary-page></os-settings-edit-dictionary-page>
    </settings-subpage>
  </template>
</settings-animated-pages>
